package com.win.service.impl;

import com.win.entities.Pay;
import com.win.mapper.PayMapper;
import com.win.service.PayService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class PayServiceImpl implements PayService {

    @Resource
    private PayMapper payMapper;
    @Override
    public int addPay(Pay pay) {
        return payMapper.insertSelective(pay);
    }

    @Override
    public int deletePay(int id) {
        return payMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int updatePay(Pay pay) {
        return payMapper.updateByPrimaryKeySelective(pay);
    }

    @Override
    public Pay getPayId(int id) {
        return payMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Pay> getPayAll() {
        return payMapper.selectAll();
    }
}
